package com.fr.web;

import com.fr.base.FRContext;
import com.fr.base.dav.LocalEnv;
import com.fr.report.ResultWorkBook;
import java.util.logging.Level;
import java.util.logging.Logger;

public class ResultResultlet extends Resultlet
{
  private String bookPath;

  public ResultResultlet(String paramString)
  {
    this.bookPath = paramString;
  }

  public ResultWorkBook createReport(ReportletRequest paramReportletRequest)
    throws ReportletException
  {
    try
    {
      if (FRContext.getCurrentEnv() instanceof LocalEnv)
        return ((LocalEnv)FRContext.getCurrentEnv()).readResult(this.bookPath);
      throw new UnsupportedOperationException("Current Env cannot Read Result;");
    }
    catch (Exception localException)
    {
      FRContext.getLogger().log(Level.WARNING, localException.getMessage(), localException);
      throw new ReportletException(localException.getMessage());
    }
  }
}